import request from "@/utils/request";

// 获取付款申请列表
export function getPaymentListApi(query, data) {
  return request({
    url: "/system/payApply/list",
    method: "post",
    params: query,
    data,
  });
}

// 获取合同用印列表
export function getContractListApi(query, data) {
  return request({
    url: "/system/purContract/selectPaymentContractList",
    method: "get"
  });
}

// 获取付款申请列表(询比价)
export function getPaymentChooseListApi(query, data) {
  return request({
    url: "/system/apply/selectMaterialInfoList",
    method: "post",
    params: query,
    data,
  });
}

// 获取付款申请明细列表
export function getPaymentDetailListApi(query, data) {
  return request({
    url: "/system/apply/selectMaterialDetailList",
    method: "post",
    params: query,
    data,
  });
}

// 新增付款申请
export function addPaymentApi(data) {
  return request({
    url: "/system/payApply/add",
    method: "post",
    data,
  });
}

// 编辑付款申请
export function editPaymentApi(data) {
  return request({
    url: "/system/payApply/edit",
    method: "post",
    data,
  });
}

// 获取付款申请详情
export function getPaymentDetailApi(paymentApplyId) {
  return request({
    url: `/system/payApply/getInfo`,
    method: "get",
    params: { paymentApplyId },
  });
}


export function getEndFlag(paymentApplyId) {
  return request({
    url: `/system/payApply/getEndFlag`,
    method: "get",
    params: { paymentApplyId },
  });
}

// 获取付款申请表格详情
export function getPaymentTableApi(purchaseApplyId) {
  return request({
    url: `/system/apply/selectMaterList`,
    method: "get",
    params: { purchaseApplyId },
  });
}

// 删除付款申请
export function deletePaymentId(paymentApplyId) {
  return request({
    url: `/system/payApply/del`,
    method: "get",
    params: { paymentApplyId },
  });
}

// 审核
export function checkPaymentApi(data) {
  return request({
    url: "/system/payApply/check",
    method: "post",
    data,
  });
}

// 付款列表保存
export function checkPaymentSaveApi(data) {
  return request({
    url: "/system/payApply/addPayRecord",
    method: "post",
    data,
  });
}

// 审核进度
export function selectAuditList(deliveryApplyId) {
  return request({
    url: `/system/payApply/selectAuditList`,
    method: "get",
    params: { deliveryApplyId },
  });
}

// 历史账号
export function getAccountListApi(deliveryApplyId) {
  return request({
    url: `/system/payApply/selectAccountCodeList`,
    method: "get",
  });
}